﻿<views:AuthView
    x:Class="SpaceNeedle.x6473.WindowsPhone.Views.Auth"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:views="clr-namespace:SpaceNeedle.x6473.WindowsPhone.Views"
    xmlns:viewmodels="clr-namespace:SpaceNeedle.x6473.WindowsPhone.ViewModels"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
    xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    FontFamily="{StaticResource PhoneFontFamilyNormal}"
    FontSize="{StaticResource PhoneFontSizeNormal}"
    Foreground="{StaticResource PhoneForegroundBrush}"
    SupportedOrientations="Portrait" Orientation="Portrait"
    mc:Ignorable="d"
    shell:SystemTray.IsVisible="False">

    <Grid>
        <phone:WebBrowser x:Name="browser" Visibility="{Binding IsAuthenticated,Converter={StaticResource InvertedBooleanToVisibilityConverter}}"/>

        <Grid Visibility="{Binding IsAuthenticated,Converter={StaticResource BooleanToVisibilityConverter}}">
            <Image HorizontalAlignment="Center" Grid.RowSpan="2" VerticalAlignment="Center" Source="{Binding BestResolutionImage, Source={StaticResource MultiResImageChooser}}" Stretch="UniformToFill"/>
            <Image Source="/Assets/microsoft-200.png" Width="200" VerticalAlignment="Top" Margin="0,80,0,0" Stretch="None" Grid.RowSpan="2"/>

            <!--TitlePanel contains the name of the application and page title-->
            <StackPanel VerticalAlignment="Center" Grid.RowSpan="2" HorizontalAlignment="Center"  Visibility="{Binding IsWelcome,Converter={StaticResource InvertedBooleanToVisibilityConverter}}">
                <Image Source="/Assets/Splash/6473-336.png" Width="150"/>
                <TextBlock Text="Cidadão" FontSize="56" Margin="0,-30,20,0" Foreground="White" FontWeight="Bold"/>
                <TextBlock Text="Conectado" FontSize="28" Margin="20,0,0,0" Foreground="White" FontWeight="Light" HorizontalAlignment="Right"/>
            </StackPanel>

            <StackPanel VerticalAlignment="Center" Grid.RowSpan="2" HorizontalAlignment="Center"  Visibility="{Binding IsWelcome, Converter={StaticResource BooleanToVisibilityConverter}}">
                <Image Source="/Assets/Splash/6473-336.png" Width="150"/>

                <TextBlock Text="Bem-Vindo!" FontSize="56" Margin="0,-30,20,0" Foreground="White" FontWeight="Bold"/>
            </StackPanel>

            <!--ContentPanel - place additional content here-->
            <TextBlock Text="Deseja realmente sair?" Margin="0,0,0,180" HorizontalAlignment="Center" VerticalAlignment="Bottom" FontSize="28" Foreground="White" FontWeight="bold"  Visibility="{Binding IsWelcome,Converter={StaticResource InvertedBooleanToVisibilityConverter}}"/>

            <Button x:Name="entrarButton" BorderBrush="{x:Null}" Content="Sim" Command="{Binding SignOutCommand}" Width="200" VerticalAlignment="Bottom" Height="90" Margin="0,0,0,50" Background="{StaticResource PhoneAccentBrush}" Foreground="White"  Visibility="{Binding IsWelcome,Converter={StaticResource InvertedBooleanToVisibilityConverter}}"/>


        </Grid>
        
        <!--<Button Content="Sair" Command="{Binding SignOutCommand}" Visibility="{Binding IsAuthenticated,Converter={StaticResource BooleanToVisibilityConverter}}"/>-->

        <ProgressBar Visibility="{Binding IsInProgress, Converter={StaticResource BooleanToVisibilityConverter}}" Style="{StaticResource ProgressStyle}" VerticalAlignment="Top" />
    </Grid>
</views:AuthView>